package com.maochang.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.maochang.mapper.PsRoleMapper;
import com.maochang.pojo.PsRole;
import com.maochang.service.PsRoleService;
import com.mysql.cj.util.StringUtils;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

@Service("PsRoleServiceImpl")
public class PsRoleServiceImpl extends ServiceImpl<PsRoleMapper,PsRole> implements PsRoleService {

    @Resource
    private   PsRoleMapper psRoleMapper;

    @Override
    public Page<PsRole> PsRoleList(Integer current, Integer page){
        Page<PsRole> psPIPage=new Page<>(current,page);
        QueryWrapper<PsRole> wrapper= Wrappers.query();
        Page<PsRole> psRolePage = psRoleMapper.selectPage(psPIPage, wrapper);
        return psRolePage;
    }

    @Override
    public List<PsRole> chaXunJueSe() {
        QueryWrapper<PsRole> wrapper= Wrappers.query();
        List<PsRole> psRoles=psRoleMapper.selectList(wrapper);
        return psRoles;
    }

}
